package com.example.a14110100409.yuejiandemo.model;

import com.example.a14110100409.yuejiandemo.javabean.Club;
import com.example.a14110100409.yuejiandemo.service.ClubService;

import java.util.List;

import retrofit2.Call;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

/**
 * Created by owner on 2017/9/25.
 */

public class ClubModel {
    private Retrofit retrofit;
    public ClubModel(){
        retrofit = new Retrofit.Builder()
                .addConverterFactory(GsonConverterFactory.create())
                .baseUrl("http://172.24.10.175/workout/api.php/")
                .build();
    }
    public retrofit2.Call<List<Club>> getclublist(){
        ClubService clubService = retrofit.create(ClubService.class);
        return  clubService.getClubList();
    }
    public Call<Club> getclubinfo(String id){
        ClubService clubService = retrofit.create(ClubService.class);
        return clubService.getClubinfo("lgj98rfkiqvenhrk2o7oe2po81","1","Clubteacher","club",id);
    }
    public Call<Club> getclassinfo(String id){
        ClubService clubService = retrofit.create(ClubService.class);
        return clubService.getClubinfo("lgj98rfkiqvenhrk2o7oe2po81","1","Clubcourse","club",id);
    }
    public Call<Club> getvideoinfo(String id){
        ClubService clubService = retrofit.create(ClubService.class);
        return clubService.getVideoinfo("lgj98rfkiqvenhrk2o7oe2po81","1","Clubvideo","club",id);
    }
    public Call<Integer> Nocollect(String club_id,int user_id){
        ClubService clubService = retrofit.create(ClubService.class);
        return clubService.Nocollect("clubfans",club_id,user_id,"lgj98rfkiqvenhrk2o7oe2po81");
    }

}
